<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  <title>minid.commandline</title>
  <link href="./css/style.css" rel="stylesheet" type="text/css"/>
  <!-- <link href="./img/icon.png" rel="icon" type="image/png"/> -->
  <script type="text/javascript" src="./js/jquery.js"></script>
  <script type="text/javascript" src="./js/modules.js"></script>
  <script type="text/javascript" src="./js/quicksearch.js"></script>
  <script type="text/javascript" src="./js/navigation.js"></script>
  <!--<script type="text/javascript" src="./js/jquery.treeview.js"></script>-->
  <script type="text/javascript">
    var g_moduleFQN = "minid.commandline";
  </script>
  
</head>
<body>
<div id="content">
  <h1><a href="./htmlsrc/minid.commandline.html" class="symbol">minid.commandline</a></h1>
  
<p class="sec_header">License:</p>Copyright (c) 2008 Jarrett Billingsley
<p class="bl"/>
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising from the
use of this software.
<p class="bl"/>
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
<p class="bl"/>
	 1. The origin of this software must not be misrepresented; you must not
	claim that you wrote the original software. If you use this software in a
	product, an acknowledgment in the product documentation would be
	appreciated but is not required.
<p class="bl"/>
	 2. Altered source versions must be plainly marked as such, and must not
	be misrepresented as being the original software.
<p class="bl"/>
	 3. This notice may not be removed or altered from any source distribution.
<dl>
<dt class="decl">struct <a class="symbol _struct" name="CommandLine" href="./htmlsrc/minid.commandline.html#L55" kind="struct" beg="55" end="489">CommandLine</a>; <a title="Permalink to this symbol" href="#CommandLine" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/minid.commandline.html#L55">#</a></dt>
<dd class="ddef">
<div class="summary">This struct encapsulates a MiniD command-line interpreter.  This is the CLI that
MDCL uses, so you can actually embed an MDCL-like interpreter in your application
by using this struct.</div>
This struct installs a signal handler that catches Ctrl+C (SIGINT) signals.  It restores
the old signal handler when it exits.
<dl>
<dt class="decl">char[] <a class="symbol _variable" name="CommandLine.Prompt1" href="./htmlsrc/minid.commandline.html#L57" kind="variable" beg="57" end="57">Prompt1</a>; <span class="attrs">[<span class="stc">const</span>]</span> <a title="Permalink to this symbol" href="#CommandLine.Prompt1" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/minid.commandline.html#L57">#</a></dt>
<dd class="ddef"></dd>
<dt class="decl">char[] <a class="symbol _variable" name="CommandLine.Prompt2" href="./htmlsrc/minid.commandline.html#L58" kind="variable" beg="58" end="58">Prompt2</a>; <span class="attrs">[<span class="stc">const</span>]</span> <a title="Permalink to this symbol" href="#CommandLine.Prompt2" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/minid.commandline.html#L58">#</a></dt>
<dd class="ddef"></dd>
<dt class="decl">char[] <a class="symbol _variable" name="CommandLine.Usage" href="./htmlsrc/minid.commandline.html#L59" kind="variable" beg="59" end="84">Usage</a>; <span class="attrs">[<span class="stc">const</span>]</span> <a title="Permalink to this symbol" href="#CommandLine.Usage" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/minid.commandline.html#L59">#</a></dt>
<dd class="ddef"></dd>
<dt class="decl">Print!(char) <a class="symbol _variable" name="CommandLine.mOutput" href="./htmlsrc/minid.commandline.html#L87" kind="variable" beg="87" end="87">mOutput</a>; <span class="attrs">[<span class="prot">private</span>]</span> <a title="Permalink to this symbol" href="#CommandLine.mOutput" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/minid.commandline.html#L87">#</a></dt>
<dd class="ddef"></dd>
<dt class="decl">LineIterator!(char) <a class="symbol _variable" name="CommandLine.mInput" href="./htmlsrc/minid.commandline.html#L88" kind="variable" beg="88" end="88">mInput</a>; <span class="attrs">[<span class="prot">private</span>]</span> <a title="Permalink to this symbol" href="#CommandLine.mInput" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/minid.commandline.html#L88">#</a></dt>
<dd class="ddef"></dd>
<dt class="decl">CommandLine <a class="symbol _function" name="CommandLine.opCall" href="./htmlsrc/minid.commandline.html#L100" kind="function" beg="100" end="106">opCall</a><span class="params">(Print!(char) <em>output</em>, InputStream <em>input</em>)</span>; <span class="attrs">[<span class="prot">public</span>, <span class="stc">static</span>]</span> <a title="Permalink to this symbol" href="#CommandLine.opCall" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/minid.commandline.html#L100">#</a></dt>
<dd class="ddef">
<div class="summary">Construct an instance of the CLI.</div>
<p class="sec_header">Params:</p>
<table class="params">
<tr><td><em>output</em></td><td>The Print object to which output will be sent.</td></tr>
<tr><td><em>input</em></td><td>The InputStream from which user input will be gathered.</td></tr></table>
<p class="sec_header">Returns:</p>An initialized instance of CommandLine.</dd>
<dt class="decl">CommandLine <a class="symbol _function" name="CommandLine.opCall:2" href="./htmlsrc/minid.commandline.html#L112" kind="function" beg="112" end="115">opCall</a><span class="params">(OutputStream <em>output</em>, InputStream <em>input</em>)</span>; <span class="attrs">[<span class="prot">public</span>, <span class="stc">static</span>]</span> <a title="Permalink to this symbol" href="#CommandLine.opCall:2" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/minid.commandline.html#L112">#</a></dt>
<dd class="ddef">
<div class="summary">Same as above, but takes a raw OutputStream for the output instead of
	a Print instance.</div></dd>
<dt class="decl">CommandLine <a class="symbol _function" name="CommandLine.opCall:3" href="./htmlsrc/minid.commandline.html#L121" kind="function" beg="121" end="124">opCall</a><span class="params">()</span>; <span class="attrs">[<span class="prot">public</span>, <span class="stc">static</span>]</span> <a title="Permalink to this symbol" href="#CommandLine.opCall:3" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/minid.commandline.html#L121">#</a></dt>
<dd class="ddef">
<div class="summary">Constructs a default instance of CommandLine which uses stdin for the input
	and stdout for the output.</div></dd>
<dt class="decl">void <a class="symbol _function" name="CommandLine.printVersion" href="./htmlsrc/minid.commandline.html#L126" kind="function" beg="126" end="129">printVersion</a><span class="params">()</span>; <span class="attrs">[<span class="prot">private</span>]</span> <a title="Permalink to this symbol" href="#CommandLine.printVersion" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/minid.commandline.html#L126">#</a></dt>
<dd class="ddef"></dd>
<dt class="decl">void <a class="symbol _function" name="CommandLine.printUsage" href="./htmlsrc/minid.commandline.html#L131" kind="function" beg="131" end="137">printUsage</a><span class="params">(char[] <em>progname</em>)</span>; <span class="attrs">[<span class="prot">private</span>]</span> <a title="Permalink to this symbol" href="#CommandLine.printUsage" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/minid.commandline.html#L131">#</a></dt>
<dd class="ddef"></dd>
<dt class="decl">void <a class="symbol _function" name="CommandLine.run" href="./htmlsrc/minid.commandline.html#L150" kind="function" beg="150" end="488">run</a><span class="params">(MDThread* <em>t</em>, char[][] <em>args</em> = null)</span>; <span class="attrs">[<span class="prot">public</span>]</span> <a title="Permalink to this symbol" href="#CommandLine.run" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/minid.commandline.html#L150">#</a></dt>
<dd class="ddef">
<div class="summary">After you've created an instance of this struct, call this method on it.  The arguments
	are the arguments that would be passed to MDCL, including the program name as item 0.
	This function returns when the user exits the interpreter (by using the exit() function,
	usually).</div>
<p class="sec_header">Params:</p>
<table class="params">
<tr><td><em>t</em></td><td>The thread to use for this CLI.</td></tr>
<tr><td><em>args</em></td><td>The arguments to the interpreter.  Defaults to null, in which case no arguments
			will be passed.</td></tr></table></dd></dl></dd></dl>
</div>
<div id="footer">
  <p></p>
  <p>Page generated by <a href="http://code.google.com/p/dil">dil</a> on Fri Dec 26 03:29:19 2008. Rendered by <a href="http://code.google.com/p/dil/wiki/Kandil">kandil</a>.</p>
</div>
</body>
</html>